Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--com.pacist.diamonds.Splitter
Field Summary | |
static int | HORIZONTAL
Used to specify a HORIZONTAL split. |
static int | VERTICAL
Used to specify a VERTICAL split. |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
Splitter()
Default Constructor, Creates a Splitter with 1 row, 2 columns and divider width of 5 pixels. |
|
Splitter(int rows,
int cols,
int hGap,
int vGap,
int defWidth,
int defHeight,
int margin,
boolean shadowed)
Constructor, Creates a Splitter using the specified values. |
|
Splitter(int rows,
int cols,
int hGap,
int vGap,
int defWidth,
int defHeight,
int margin)
Creates a Splitter using the specified parameters. |
|
Splitter(int rows,
int cols)
Constructor, Creates a Splitter using the specified parameters. |
|
Splitter(int rows,
int cols,
boolean shadowed)
Constructor, Creates a Splitter using the parameters. |
Method Summary | |
void | addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void | addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified named component to the layout. |
int | colSpaceLeft()
Calculates total space needed by components in a row |
int | dividerPos(int[] a,
int x,
int gap)
Calculates the position of the feedback divider during drag. |
void | drawDivider()
Draws the line that is a feedback to the user when resizing a row or a column |
void | drawLineInChildren(int x,
int y,
java.awt.Component[] c)
Draws the line in the components as well. |
int | findDivider(int[] a,
int x,
int gap)
Detects whether the user has clicked on a divider |
int | getCols()
Returns the number of columns. |
int | getColWidth(int column)
Gets the width of one column. |
boolean[] | getFillCols()
Gets which columns will size proportionally to the size of the container. |
boolean[] | getFillRows()
Gets which rows will size proportionally to the size of the container. |
int | getHGap()
Returns the value of the height of the horizontal dividers. |
float | getLayoutAlignmentX(java.awt.Container parent)
Returns the alignment along the x axis. |
float | getLayoutAlignmentY(java.awt.Container parent)
Returns the alignment along the y axis. |
int | getRowHeight(int row)
Gets the height of one row. |
int | getRows()
Returns the number of rows. |
int | getVGap()
Returns the value of the width of the vertical dividers. |
void | invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void | layoutContainer(java.awt.Container target)
Lays out the specified container. |
java.awt.Dimension | maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions for this layout given the components in the specified target container. |
java.awt.Dimension | minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container. |
void | mouseClicked(java.awt.event.MouseEvent e)
|
void | mouseDragged(java.awt.event.MouseEvent e)
Drags the divider... |
void | mouseEntered(java.awt.event.MouseEvent e)
Sets the cursor back to default when the mouse enters a child component. |
void | mouseExited(java.awt.event.MouseEvent e)
Sets the cursor back to default when the Splitter loses focus. |
void | mouseMoved(java.awt.event.MouseEvent e)
Decides if the mouse is on a divider to change to cursor to indicate to the user that the divider can be moved. |
void | mousePressed(java.awt.event.MouseEvent e)
Sets up the environment for dragging a divider. |
void | mouseReleased(java.awt.event.MouseEvent e)
Locates the position of the divider and forces the window to display the change. |
void | paint(java.awt.Graphics g)
Redraws the Splitter on the window. |
java.awt.Dimension | preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
void | removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
int | rowSpaceLeft()
Calculates total space needed by components in a column |
void | setCols(int col)
Reformats the Splitter to contain the number of specified columns. |
void | setColWidth(int column,
int width)
Sets the width of one column. |
void | setFillCols(boolean[] fillCols)
Sets which columns will size proportionally to the size of the container. |
void | setFillRows(boolean[] fillRows)
Sets which rows will size proportionally to the size of the container. |
void | setHGap(int val)
Modifies the height of the horizontal dividers. |
void | setRowHeight(int row,
int height)
Sets the height of one row. |
void | setRowsAndCols(int row,
int col)
Reformats the Splitter to contain the number of specified rows and columns. |
void | setRows(int row)
Reformats the Splitter to contain the number of specified rows. |
void | setVGap(int val)
Modifies the width of the vertical dividers. |
Methods inherited from class java.awt.Panel | |
addNotify |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
Constructor Detail |
public Splitter()
public Splitter(int rows, int cols, int hGap, int vGap, int defWidth, int defHeight, int margin, boolean shadowed)
rows
- number of rows in the Splitter.
cols
- number of columns in the Splitter.
hGap
- horizontal gap between each component.
vGap
- vertical gap between each component.
defWidth
- default width of each component.
defHeight
- default height of each component.
margin
- border margin.
shadowed
- draw (or don't draw) a shadow showing where the
draggable divider is.public Splitter(int rows, int cols, int hGap, int vGap, int defWidth, int defHeight, int margin)
rows
- number of rows in the Splitter.
cols
- number of columns in the Splitter.
hGap
- horizontal gap between each component.
vGap
- vertical gap between each component.
defWidth
- default width of each component.
defHeight
- default height of each component.
margin
- border margin.public Splitter(int rows, int cols)
rows
- number of rows in the Splitter.
cols
- number of columns in the Splitter.public Splitter(int rows, int cols, boolean shadowed)
rows
- number of rows in the Splitter.
cols
- number of columns in the Splitter.
shadowed
- draw (or don't draw) a shadow showing where the
draggable divider is.Method Detail |
public void setRows(int row)
row
- number of rows in the Splitter.public void setRowHeight(int row, int height)
row
- the row to adjust.
height
- the new height.public int getRowHeight(int row)
row
- the specified row.public void setColWidth(int column, int width)
column
- the column to adjust.
width
- the new width.public int getColWidth(int column)
column
- the specified column.public int getRows()
int
- number of rows in the Splitter.public void setCols(int col)
col
- number of columns in the Splitter.public int getCols()
int
- number of rows in the Splitter.public void setRowsAndCols(int row, int col)
row
- number of rows in the Splitter.
col
- number of columns in the Splitter.public void setFillRows(boolean[] fillRows)
fillRows
- which rows will be proportional.public boolean[] getFillRows()
boolean[]
- array of 'growing' rows.public void setFillCols(boolean[] fillCols)
fillCols
- which columns will be proportional.public boolean[] getFillCols()
boolean[]
- array of 'growing' columns.public void setHGap(int val)
val
- height of the divider.public void setVGap(int val)
val
- width of the divider.public int getVGap()
int
- width of the divider.public int getHGap()
int
- height of the divider.public void paint(java.awt.Graphics g)
g
- the graphics context.protected void drawDivider()
protected void drawLineInChildren(int x, int y, java.awt.Component[] c)
x
- the x co-ordinate.
y
- the y co-ordinate.
c
- array of all child components.protected int findDivider(int[] a, int x, int gap)
a
- array of element width/height.
x
- location where mouse has been clicked (x if checking for rows, y if checking for columns).
gap
- space between each component i.e. width/height of dividers.int
- -1
if it could not find row or column; otherwise row or column number.protected int dividerPos(int[] a, int x, int gap)
a
- array of element width/height.
x
- row/column number of the dragged divider.
gap
- space between each component i.e. width/height of dividers.int
x/y coordinate of where to draw the divider.public void mousePressed(java.awt.event.MouseEvent e)
e
- co-ordinate details of where the mouse was pressed.public void mouseDragged(java.awt.event.MouseEvent e)
e
- co-ordinate details of where the mouse was dragged.public void mouseReleased(java.awt.event.MouseEvent e)
e
- co-ordinate details of where the mouse was released.public void mouseMoved(java.awt.event.MouseEvent e)
e
- details of where the mouse was moved.public void mouseExited(java.awt.event.MouseEvent e)
e
- mouse event details.public void mouseEntered(java.awt.event.MouseEvent e)
e
- the mouse event.public void mouseClicked(java.awt.event.MouseEvent e)
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
comp
- the component to be added.
constraints
- where/how the component is added to the layout.public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
name
- the String name.
comp
- the component to be added.public void removeLayoutComponent(java.awt.Component comp)
comp
- the component to be removed.public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
target
- the Container on which to do the layout.Dimension
- the minimum layout size.public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
target
- the component which needs to be laid out.Dimension
- the preferred layout size.public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
target
- the component which needs to be laid out.Dimension
- the maximum layout size.public float getLayoutAlignmentX(java.awt.Container parent)
float
- the alignment.public float getLayoutAlignmentY(java.awt.Container parent)
float
- the alignment.public void invalidateLayout(java.awt.Container target)
public int colSpaceLeft()
int
- space left.public int rowSpaceLeft()
int
- space left.public void layoutContainer(java.awt.Container target)
target
- the component being laid out.Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |